<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      v-show="showSearch"
      label-width="100px"
    >
      <!-- <el-form-item label="学生姓名" prop="studentName">
        <el-input
          v-model="queryParams.studentName"
          placeholder="请输入学生姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="性别" prop="gender">
        <el-input
          v-model="queryParams.gender"
          placeholder="请输入性别"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="年龄" prop="age">
        <el-input
          v-model="queryParams.age"
          placeholder="请输入年龄"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="身高" prop="heightNum">
        <el-input
          v-model="queryParams.heightNum"
          placeholder="请输入身高"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="体重" prop="weightNum">
        <el-input
          v-model="queryParams.weightNum"
          placeholder="请输入体重"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="学籍所在学校" prop="schoolRoll">
        <el-input
          v-model="searchSchool"
          placeholder="请输入学籍所在学校"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="父亲名字" prop="fatherName">
        <el-input
          v-model="queryParams.fatherName"
          placeholder="请输入父亲1名字"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="父亲联系方式" prop="fatherPhone">
        <el-input
          v-model="queryParams.fatherPhone"
          placeholder="请输入父亲联系方式"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="母亲名字" prop="motherName">
        <el-input
          v-model="queryParams.motherName"
          placeholder="请输入母亲名字"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="母亲联系方式" prop="motherPhone">
        <el-input
          v-model="queryParams.motherPhone"
          placeholder="请输入母亲联系方式"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="收件地址" prop="address">
        <el-input
          v-model="queryParams.address"
          placeholder="请输入收件地址"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="删除状态" prop="deleted">
        <el-input
          v-model="queryParams.deleted"
          placeholder="请输入删除状态"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="登记状态" prop="signStatus">
        <el-select v-model="queryParams.signStatus" placeholder="请选择登记状态" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="身份证号" prop="certNumber">
        <el-input
          v-model="queryParams.certNumber"
          placeholder="请输入身份证号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="户口所在地" prop="certRoll">
        <el-input
          v-model="queryParams.certRoll"
          placeholder="请输入户口所在地"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="证件照" prop="studentPhtot">
        <el-input
          v-model="queryParams.studentPhtot"
          placeholder="请输入证件照"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-message"
          size="mini"
          @click="sendMessage"
          >发送短信</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['jw:signStudentApply:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['jw:signStudentApply:remove']"
          >删除</el-button
        >
      </el-col>

      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getPage"
      ></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="signStudentApplyList"
      border
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="id" align="center" prop="id" v-if="false" />
      <el-table-column
        label="学生姓名"
        align="center"
        prop="studentName"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="性别"
        sortable
        align="center"
        prop="gender"
        :show-overflow-tooltip="true"
      >
        <template slot-scope="scope">
          <p v-if="scope.row.gender === 1">男</p>
          <p v-if="scope.row.gender === 0">女</p>
        </template>
      </el-table-column>
      <el-table-column
        label="年龄"
        sortable
        align="center"
        prop="age"
        :show-overflow-tooltip="true"
      />
      <!-- <el-table-column
        label="身高"
        sortable
        align="center"
        prop="heightNum"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="体重"
        sortable
        align="center"
        prop="weightNum"
        :show-overflow-tooltip="true"
      /> -->
      <el-table-column
        label="学籍所在学校"
        align="center"
        prop="schoolRoll"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="父亲名字"
        align="center"
        prop="fatherName"
        :show-overflow-tooltip="true"
      />
      <!-- <el-table-column
        label="父亲联系方式"
        align="center"
        prop="fatherPhone"
        :show-overflow-tooltip="true"
      /> -->
      <el-table-column
        label="母亲名字"
        align="center"
        prop="motherName"
        :show-overflow-tooltip="true"
      />
      <!-- <el-table-column
        label="母亲联系方式"
        align="center"
        prop="motherPhone"
        :show-overflow-tooltip="true"
      /> -->
      <el-table-column
        label="收件地址"
        align="center"
        prop="address"
        :show-overflow-tooltip="true"
      />
      <!-- <el-table-column
        label="身份证号"
        align="center"
        prop="certNumber"
        :show-overflow-tooltip="true"
      /> -->
      <el-table-column
        label="户口所在地"
        align="center"
        prop="certRoll"
        :show-overflow-tooltip="true"
      />
        <el-table-column
        label="推荐人"
        align="center"
        prop="remark"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="才艺展示"
        sortable
        align="center"
        prop="artSelect"
        :show-overflow-tooltip="true"
      >
        <template slot-scope="scope">
          <p v-if="scope.row.artSelect === 0">拉丁舞专业展示</p>
          <p v-if="scope.row.artSelect === 1">标准舞专业展示</p>
          <p v-if="scope.row.artSelect === 2">其他（中国舞、芭蕾舞、街舞、现代舞）</p>
          <p v-if="scope.row.artSelect === 3">现代舞展示</p>
          <p v-if="scope.row.artSelect === 4">民族民间舞展示</p>
          <p v-if="scope.row.artSelect === 5">街舞等其他舞种展示</p>
          <p v-if="scope.row.artSelect === 6">
            声乐、器乐等其他非舞蹈类才艺展示
          </p>
        </template>
      </el-table-column>
      <el-table-column
        label="证件照"
        align="center"
        prop="studentPhtot"
        :show-overflow-tooltip="true"
      >
        <template slot-scope="scope">
          <el-image
            :src="scope.row.studentPhtot"
            :preview-src-list="[scope.row.studentPhtot]"
          ></el-image>
        </template>
      </el-table-column>
      <!-- <el-table-column
        label="短信"
        align="center"
        prop="deleted"
        :show-overflow-tooltip="true"
      >
        <template slot-scope="scope">
          <p v-if="scope.row.deleted === 1">已发送</p>
          <p v-if="scope.row.deleted === 2">发送失败</p>
          <p v-if="scope.row.deleted != 1">未发送</p>
        </template>
      </el-table-column> -->
      <!-- <el-table-column
        label="报名表"
        align="center"
        :show-overflow-tooltip="true"
      >
        <template slot-scope="scope">
          <el-button @click="getReportTable(scope.row)" type="text" size="small"
            >查看</el-button
          >
        </template>
      </el-table-column> -->
      <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['jw:signStudentApply:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['jw:signStudentApply:remove']"
          >删除</el-button>
        </template>
      </el-table-column> -->
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getPage"
    />

    <!-- 添加或修改报名登记学生对话框 -->
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="635px"
      append-to-body
      :close-on-click-modal="false"
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-col :span="12">
          <el-form-item label="学生姓名" prop="studentName">
            <el-input v-model="form.studentName" placeholder="请输入学生姓名" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="性别" prop="gender">
            <el-input v-model="form.gender" placeholder="请输入性别" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="年龄" prop="age">
            <el-input v-model="form.age" placeholder="请输入年龄" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="身高" prop="heightNum">
            <el-input v-model="form.heightNum" placeholder="请输入身高" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="体重" prop="weightNum">
            <el-input v-model="form.weightNum" placeholder="请输入体重" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="学籍所在学校" prop="schoolRoll">
            <el-input
              v-model="form.schoolRoll"
              placeholder="请输入学籍所在学校"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="监护人1名字" prop="fatherName">
            <el-input
              v-model="form.fatherName"
              placeholder="请输入监护人1名字"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="监护人1联系方式" prop="fatherPhone">
            <el-input
              v-model="form.fatherPhone"
              placeholder="请输入监护人1联系方式"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="监护人2名字" prop="motherName">
            <el-input
              v-model="form.motherName"
              placeholder="请输入监护人2名字"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="监护人2联系方式" prop="motherPhone">
            <el-input
              v-model="form.motherPhone"
              placeholder="请输入监护人2联系方式"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="收件地址" prop="address">
            <el-input v-model="form.address" placeholder="请输入收件地址" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="删除状态" prop="deleted">
            <el-input v-model="form.deleted" placeholder="请输入删除状态" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="登记状态">
            <el-radio-group v-model="form.signStatus">
              <el-radio label="1">请选择字典生成</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="身份证号" prop="certNumber">
            <el-input v-model="form.certNumber" placeholder="请输入身份证号" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="户口所在地" prop="certRoll">
            <el-input v-model="form.certRoll" placeholder="请输入户口所在地" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="证件照" prop="studentPhtot">
            <el-input v-model="form.studentPhtot" placeholder="请输入证件照" />
          </el-form-item>
        </el-col>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog title="发送短信" :visible.sync="sendMessageDig">
      <el-row>
        <el-col>
          <el-divider content-position="left">短信内容</el-divider>
          家长您好，
          您所提交的报名照片与要求不符，请在微信报名小程序中修改（2寸免冠证件照，要求红、白或蓝底，大小不超2M）
        </el-col>
      </el-row>

      <!-- <el-row >
<el-col>
   <el-divider content-position="left">短信发送优先级</el-divider>
<el-switch
  v-model="sendByFarther"
   active-color="#13ce66"
  inactive-color="#F56C6C"
  active-text="优先父亲"
  inactive-text="优先母亲">
</el-switch>



</el-col>
</el-row> -->
      <el-row>
        <el-col>
          <el-divider content-position="left">命令</el-divider>
          <el-button type="primary" @click="doSend">发送</el-button>
        </el-col>
      </el-row>
    </el-dialog>

    <el-dialog
      id="reportTableInfox"
      :visible.sync="signStudentReportDialog"
      title="报名表"
      append-to-body
      :close-on-click-modal="false"
    >
      <table class="reportTable" id="reportTableInfo">
        <tr>
          <td>姓名</td>
          <td>{{ showStudentReport.studentName }}</td>
          <td>性别</td>
          <td>
            <span v-if="showStudentReport.gender === 0">女</span>
            <span v-if="showStudentReport.gender != 0">男</span>
          </td>
          <td :rowspan="3">
            <el-image
              :src="showStudentReport.studentPhtot"
              fit="fill"
              style="width: 150px; height: 200px"
            ></el-image>
          </td>
        </tr>
        <tr>
          <td>年龄</td>
          <td>{{ showStudentReport.age }}岁</td>
          <td>出生年月</td>
          <td>{{ getThisStudentBirth(showStudentReport.certNumber) }}</td>
        </tr>
        <tr>
          <td>身高</td>
          <td>{{ showStudentReport.heightNum }}公分</td>
          <td>体重</td>
          <td>{{ showStudentReport.weightNum }}公斤</td>
        </tr>
        <tr>
          <td>户口所在地</td>

          <td :colspan="4">
            {{ showStudentReport.certRoll }}
          </td>
        </tr>

        <tr>
          <td>父亲姓名</td>

          <td>
            {{ showStudentReport.fatherName }}
          </td>
          <td>父亲联系方式</td>

          <td :colspan="4">
            {{ showStudentReport.fatherPhone }}
          </td>
        </tr>
        <tr>
          <td>母亲姓名</td>
          <td>
            {{ showStudentReport.motherName }}
          </td>
          <td>母亲联系方式</td>
          <td :colspan="4">
            {{ showStudentReport.motherPhone }}
          </td>
        </tr>
        <tr>
          <td>通知书寄送地址</td>
          <td :colspan="5">
            {{ showStudentReport.address }}
          </td>
        </tr>
        <tr>
          <td>学籍所在地</td>
          <td :colspan="5">
            {{ showStudentReport.schoolRoll }}
          </td>
        </tr>
        <tr>
          <td>第一轮考试成绩</td>
          <td :colspan="5">
            <p v-if="resultStudent.matchOneResult === '1'">通过</p>
            <p v-if="resultStudent.matchOneResult === '0'">通过</p>
          </td>
        </tr>
        <tr>
          <td>第二轮考试成绩</td>

          <td :colspan="5">
            <p v-if="resultStudent.matchTwoResult === '1'">通过</p>
            <p v-if="resultStudent.matchTwoResult === '0'">通过</p>
          </td>
        </tr>
        <tr>
          <td>第三轮考试成绩</td>

          <td :colspan="5">
            <p v-if="resultStudent.matchThreeResult === '1'">通过</p>
            <p v-if="resultStudent.matchThreeResult === '0'">通过</p>
          </td>
        </tr>
        <tr>
          <td>才艺展示成绩</td>

          <td :colspan="5">
            {{ resultStudent.matchFourResult }}
          </td>
        </tr>
        <tr>
          <td>语文成绩</td>
          <td :colspan="5">
            {{ resultStudent.chineseResult }}
          </td>
        </tr>
        <tr>
          <td>数学成绩</td>
          <td :colspan="5">
            {{ resultStudent.mathReuslt }}
          </td>
        </tr>
        <tr>
          <td>英语成绩</td>
          <td :colspan="5">
            {{ resultStudent.englishResult }}
          </td>
        </tr>
        <!-- <tr>  </tr> -->
      </table>
      <el-row type="flex" justify="center" align="middle">
        <el-col :span="4">
          <el-button @click="toPrint">打印此页</el-button></el-col
        >
        <el-col :span="4">
          <el-button @click="signStudentReportDialog = false"
            >关闭此页</el-button
          ></el-col
        >
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
// import {
//   getStudentResultByID,
//   pageSignStudentMatchInfo,
//   getSignStudentMatchInfo,
//   delSignStudentMatchInfo,
//   addSignStudentMatchInfo,
//   updateSignStudentMatchInfo,
//   exportSignStudentMatchInfo,
// } from "@/api/jw/signStudentMatchInfo";

import {
  searchSchoolByNamexx,
  sendSMS,
  pageSignStudentApply,
  getSignStudentApply,
  delSignStudentApply,
  addSignStudentApply,
  updateSignStudentApply,
  exportSignStudentApply,
} from "@/api/hnsdsa/signStudent/signStudentInSystem";
// import printJS from "print-js";
export default {
  name: "SignStudentApply",
  components: {},
  data() {
    return {
      resultStudent:{},
      // 遮罩层
      loading: true,
      signStudentReportDialog: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 报名登记学生表格数据
      signStudentApplyList: [],
      selectReason: "",

      // 弹出层标题
      title: "",
      SelectReasons: [
        { label: "照片不合规", value: 0 },
        { label: "寄送地址不合规", value: 1 },
        {
          label: "户口所在地不合格",
          value: 2,
        },
        {
          label: "户口所在地不合格1",
          value: 3,
        },
      ],
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        studentName: undefined,
        gender: undefined,
        age: undefined,
        heightNum: undefined,
        weightNum: undefined,
        schoolRoll: undefined,
        fatherName: undefined,
        fatherPhone: undefined,
        motherName: undefined,
        motherPhone: undefined,
        address: undefined,
        deleted: undefined,
        signStatus: undefined,
        certNumber: undefined,
        certRoll: undefined,
        studentPhtot: undefined,
      },
      sendMessageDig: false,
      sendByFarther: true,
      searchSchool: "",
      showStudentReport: {},
      // 表单参数
      form: {},
      // 表单校验
      rules: {},
    };
  },
  created() {
    this.getPage();
  },
  methods: {
    /** 查询报名登记学生列表 */
    getPage() {
      this.loading = true;
      pageSignStudentApply(this.queryParams).then((response) => {
        this.signStudentApplyList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        studentName: undefined,
        gender: undefined,
        age: undefined,
        heightNum: undefined,
        weightNum: undefined,
        schoolRoll: undefined,
        fatherName: undefined,
        fatherPhone: undefined,
        motherName: undefined,
        motherPhone: undefined,
        address: undefined,
        createTime: undefined,
        deleted: undefined,
        signStatus: 0,
        certNumber: undefined,
        certRoll: undefined,
        studentPhtot: undefined,
        remark:undefined,
      };
      this.resetForm("form");
    },



    /** 搜索按钮操作 */
    handleQuery() {
      console.log(this.searchSchool);
      this.queryParams.pageNum = 1;
      searchSchoolByNamexx(this.searchSchool).then((response) => {
        this.loading = true;
        this.signStudentApplyList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
      // this.getPage();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.getPage();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加报名登记学生";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getSignStudentApply(id).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改报名登记学生";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updateSignStudentApply(this.form).then((response) => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getPage();
            });
          } else {
            addSignStudentApply(this.form).then((response) => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getPage();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm(
        '是否确认删除报名登记学生编号为"' + ids + '"的数据项?',
        "警告",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      )
        .then(function () {
          return delSignStudentApply(ids);
        })
        .then(() => {
          this.getPage();
          this.msgSuccess("删除成功");
        });
    },

    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm("是否确认导出所有报名登记学生数据项?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(function () {
          return exportSignStudentApply(queryParams);
        })
        .then((response) => {
          this.download(response.msg);
        });
    },

    sendMessage(row) {
      this.sendMessageDig = true;
      const ids = row.id || this.ids;
    },
    doSend(row) {
      const ids = row.id || this.ids;
      console.log(ids);
      sendSMS(ids).then((response) => {
        console.log(response.data.length);

        this.msgSuccess(
          "短信已成功发送，共计" + response.data.length + "条短信"
        );
        this.sendMessageDig = false;
        this.getPage();
      });
    },
    // getReportTable(signStudentApply) {
    //   var that = this;
    //   (this.signStudentReportDialog = true),
    //     (this.showStudentReport = signStudentApply);
    //   console.log(46818311);
    //   console.log(this.showStudentReport.id);
    //   this.getStudentResultByIDx(this.showStudentReport.id);
    // },
    getThisStudentBirth(idCard) {
      console.log(idCard);
      if (idCard === undefined) {
        idCard = "41070319920826203x";
      }
      var birthStr;
      if (15 == idCard.length) {
        birthStr = idCard.charAt(6) + idCard.charAt(7);
        if (parseInt(birthStr) < 10) {
          birthStr = "20" + birthStr;
        } else {
          birthStr = "19" + birthStr;
        }
        birthStr =
          birthStr +
          "-" +
          idCard.charAt(8) +
          idCard.charAt(9) +
          "-" +
          idCard.charAt(10) +
          idCard.charAt(11);
      } else if (18 == idCard.length) {
        birthStr =
          idCard.charAt(6) +
          idCard.charAt(7) +
          idCard.charAt(8) +
          idCard.charAt(9) +
          "-" +
          idCard.charAt(10) +
          idCard.charAt(11) +
          "-" +
          idCard.charAt(12) +
          idCard.charAt(13);
      }
      return birthStr;
    },
    toPrint() {
      printJS({
        printable: "reportTableInfo",
        type: "html",
        style:
          '.reportTable {  border-collapse: collapse;border:solid 1px;margin: 0;width: 100%;height: 100%;}.reportTable td{border: solid 1px;height: 60px;text-align:center;font: 1em "宋体" bold;}',
      });
    },
    // getStudentResultByIDx(id) {
    //   getStudentResultByID(id).then((response) => {
    //     console.log(response.data);
    //     this.resultStudent = response.data;
    //   });
    // },
  },
};
</script>
<style scoped>
.reportCol {
  margin-top: 30px;
}
.reportRow {
  /* border-top: solid 1px;
border-left: solid 1px; */
}
.reportTable {
  border-collapse: collapse;
  border: solid 1px;
  margin: 0;
  width: 100%;
  height: 100%;
}
.reportTable td {
  border: solid 1px;
  height: 60px;
  text-align: center;
  font: 1em "宋体" bold;
}
@import url("/node_modules/print-js/dist/print.css");
</style>
